-- azrael_summon
-- create by zhuangsl
-- 技能：召唤阿兹猫
-- azrael(prop_id):prop_id为男巫强化等级对应的prop_id

return {
    apply = function(source, target, skillId, round, para, extra)
        local propId = para;
        -- 男巫专属强化效果
        local prop = PropM.combine(source, propId, 1);
        local level = PropM.apply(prop, 0);

        propId = PropM.getPropId("aid_attrib2");

        -- 这里记下阿兹猫每次复活的属性增益，属性增加在召唤兽初始化时处理
        -- 先删掉旧的prop再重新记
        local hpProp = PropM.combine(source, propId, "azrael_hp");
        local atkProp = PropM.combine(source, propId, "azrael_attack");
        PropM.deleteProp(source, "azrael");
        if level >= 1 then
            -- 每次复活生命值+20
            hpProp[3] = hpProp[3] + 20;
            PropM.record(source, hpProp, "azrael");
        end
        if level >= 2 then
            -- 每次复活攻击+1
            atkProp[3] = atkProp[3] + 1;
            PropM.record(source, atkProp, "azrael");
        end

        -- 不同级别召唤的阿兹猫不同
        local summonId;
        if level <= 2 then
            summonId = 16;
        elseif level == 3 then
            summonId = 17;
        elseif level == 4 then
            summonId = 18;
        else
            summonId = 19;
        end

        -- 探索点消耗
        local cost = 100;
        source:costAttrib("search_point", cost);

        -- 召唤
        SummonM.doSummon(summonId);
    end,

    parse = function(desc)
        local arr = string.explode(desc, ",");
        return tonumber(arr[1]);
    end,

    -- 解析技能描述
    parseDesc = function(source, skillId, desc, para)
        return desc;
    end,
};
